Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
"cannot find -lucontext" when installing some rubygems on newly pushed docker image ruby:2.7.4-alpine3.13

I can no longer install the Rubygems byebug and racc on the ruby:2.7.4-alpine3.13 image that was pushed in the last day. It seems something has been removed or moved.

To reproduce:

docker pull ruby:2.7.4-alpine3.13
2.7.4-alpine3.13: Pulling from library/ruby
Digest: sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
Status: Image is up to date for ruby:2.7.4-alpine3.13

docker run --rm -it --entrypoint /bin/sh ruby@sha256:89b589e1b6b334ed7af93da3d4c75dca5beef8f1a844594c3a865bc6c4f5b96e
apk --no-cache add "build-base>=0.5"
gem install byebug

gives me:

Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.

Following the logs down, I get:

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r ./siteconf20211027-12-7c6k46.rb extconf.rb
creating Makefile

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.so
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lucontext
collect2: error: ld returned 1 exit status
make: *** [Makefile:262: byebug.so] Error 1

Looking for the header files we get:

find . -name ucontext.h
./usr/include/asm/ucontext.h
./usr/include/asm-generic/ucontext.h
./usr/include/sys/ucontext.h
./usr/include/ucontext.h

Installation of the byebug gem works using the digest to define the image that ruby:2.7.4-alpine3.13 used to be on 19 October 2021 (ruby@sha256:ace3785b1a5eb95d08285f8741e3dc1c481c479a271d54e37b8e45a7106d86c6) but the image was updated in the last day, and something has changed in it.

When I run find . -name ucontext.h on the working image, the files are in the same location.

Anyone have any thoughts on how to get this working?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I ran into the same issue. Seems like it was caused by this commit I manually added the libucontext-dev Alpine package and included the command export LIBS='-lucontext' to my Dockerfile and my build started working again.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda